import request from '@/utils/request'
//  获取配置
export function getShareSettings(params) {
  return request({
    url: '/cloudApi/marketing/shareSettings/getShareSettings',
    method: 'get',
    params
  })
}

/**
 * 保存分享配置
 * @param data
 * @returns {AxiosPromise}
 */
export function saveShareSettings(data) {
  return request({
    url: '/cloudApi/marketing/shareSettings/saveShareSettings',
    method: 'post',
    data
  })
}
/**
 *获取分享商品
 * @param params
 * @returns {AxiosPromise}
 */
export function getGoodsList(params) {
  return request({
    url: '/cloudApi/marketing/shareGoods/getGoodsList',
    method: 'get',
    params
  })
}

/**
 * 获取商品分类
 * @param params
 * @returns {AxiosPromise}
 */
export function getGoodsCategoryList(params) {
  return request({
    url: '/cloudApi/goods/goodsCategory/getGoodsCategoryList',
    method: 'get',
    params
  })
}

/**
 * 获取分享列表
 * @param params
 * @returns {AxiosPromise}
 */
export function getShareGoodsList(params) {
  return request({
    url: '/cloudApi/marketing/shareGoods/getShareGoodsList',
    method: 'get',
    params
  })
}

/**
 * 添加分享商品
 * @param data
 * @returns {AxiosPromise}
 */

export function saveShareGood(data) {
  return request({
    url: '/cloudApi/marketing/shareGoods/saveShareGoods',
    method: 'post',
    data
  })
}

/**
 * 批量添加商品
 */

export function saveShareGoodsBatch(data) {
  return request({
    url: '/cloudApi/marketing/shareGoods/saveShareGoodsBatch',
    method: 'post',
  })
}

/**
 * 移除分享商品
 */

export function removeShareGoods(data) {
  return request({
    url: '/cloudApi/marketing/shareGoods/removeShareGoods',
    method: 'post',
    data
  })
}

/**
 * 批量删除分享商品
 */

export function removeShareGoodsBatch(data) {
  return request({
    url: '/cloudApi/marketing/shareGoods/removeShareGoodsBatch',
    method: 'post',
    data
  })
}

/**
 * 分享商品状态
 */
export function updateStatus(data) {
  return request({
    url: '/cloudApi/marketing/shareGoods/updateStatus',
    method: 'post',
    data
  })
}

/**
 * 分享客列表
 * @param params
 * @returns {AxiosPromise}
 */
export function getShareCustomerList(params) {
  return request({
    url: '/cloudApi/marketing/shareCustomer/getShareCustomerList',
    method: 'get',
    params
  })
}

/**
 * 分账明细
 */

export function getDetail(params) {
  return request({
    url: '/cloudApi/marketing/shareCustomer/getDetail',
    method: 'get',
    params
  })
}

/**
 * 审核列表
 */
export function getAuditList(params) {
  return request({
    url: '/cloudApi/marketing/shareCustomer/getAuditList',
    method: 'get',
    params
  })
}

/**
 * 审核
 */

export function audit(data) {
  return request({
    url: '/cloudApi/marketing/shareCustomer/audit',
    method: 'post',
    data
  })
}

/**
 * 批量审核
 */

export function auditBatch(data) {
  return request({
    url: '/cloudApi/marketing/shareCustomer/auditBatch',
    method: 'post',
    data
  })
}

/**
 * 邀请明细
 */
export function getMyInviteList(params) {
  return request({
    url: '/cloudApi/marketing/userInvite/getMyInviteList',
    method: 'get',
    params
  })
}

/**
 * 冻结用户
 */
export function updateUserStatus(data) {
  return request({
    url: '/cloudApi/account/user/updateStatus',
    method: 'post',
    data
  })
}

